/**
 * Created by sunlei on 2015/8/28.
 */
class A{
    static String name="a"

    public A(){
        printName()
    }

    public void printName(){
        println(name)
    }
}

class B extends A{
    static String name="b"

    public B(){
        printName()
    }

    //覆盖父类方法，父类也调用子类的方法
    public void printName(){
        println(name)
    }
}

B b=new B()


